using System;
using FU.Capstones.IMS.Web.Common;
using FU.Capstones.IMS.Web.Common.InventoryServiceProxy.DataContracts;
using FU.Capstones.IMS.Web.Common.InventoryServiceProxy.EventArgs;

namespace FU.Capstones.IMS.Web.Silverlight.Models
{
    public class EmploymentTypeListModel : ModelBase
    {
        public EmploymentTypeListModel()
        {
            client.DeleteEmploymentTypeCompleted += DoDeleteEmploymentTypeCompleted;
            client.UndoDeleteEmploymentTypeCompleted += DoUndoDeleteEmploymentTypeCompleted;
            client.GetEmploymentTypeCollectionCompleted += DoGetEmploymentTypeCollectionCompleted;
            client.GetSingleEmploymentTypeCompleted += DoGetSingleEmploymentTypeCompleted;
            client.SearchEmploymentTypeCompleted += DoSearchEmploymentTypeCompleted;
            client.UpdateEmploymentTypeCompleted += DoUpdateEmploymentTypeCompleted;
            client.InsertEmploymentTypeCompleted += DoInsertEmploymentTypeCompleted;
        }

        #region InsertEmploymentType

        public event EventHandler<SingleFeedbackCompletedEventArgs<int>> InsertEmploymentTypeCompleted;

        public int InsertEmploymentTypeAsync(EmploymentType data)
        {
            client.InsertEmploymentTypeAsync(data);
            return WebConstants.MagicNumer;
        }

        void DoInsertEmploymentTypeCompleted(object sender, SingleFeedbackCompletedEventArgs<int> e)
        {
            if (InsertEmploymentTypeCompleted != null)
            {
                InsertEmploymentTypeCompleted(sender, e);
            }
        }

        #endregion

        #region UpdateEmploymentType

        public event EventHandler<FeedbackCompletedEventArgs> UpdateEmploymentTypeCompleted;

        public int UpdateEmploymentTypeAsync(EmploymentType data)
        {
            client.UpdateEmploymentTypeAsync(data);
            return WebConstants.MagicNumer;
        }

        void DoUpdateEmploymentTypeCompleted(object sender, FeedbackCompletedEventArgs e)
        {
            if (UpdateEmploymentTypeCompleted != null)
            {
                UpdateEmploymentTypeCompleted(sender, e);
            }
        }

        #endregion

        #region SearchEmploymentType

        public event EventHandler<CollectionFeedbackCompletedEventArgs<EmploymentType>> SearhEmploymentTypeCompleted;

        public int SearchEmploymentTypeAsync(EmploymentType criteria)
        {
            client.SearchEmploymentTypeAsync(criteria);
            return WebConstants.MagicNumer;
        }

        void DoSearchEmploymentTypeCompleted(object sender, CollectionFeedbackCompletedEventArgs<EmploymentType> e)
        {
            if (SearhEmploymentTypeCompleted != null)
            {
                SearhEmploymentTypeCompleted(sender, e);
            }
        }

        #endregion

        #region GetEmploymentTypeCollection

        public event EventHandler<CollectionFeedbackCompletedEventArgs<EmploymentType>> GetEmploymentTypeCollectionCompleted;

        public int GetEmploymentTypeCollectionAsync(bool isShowAll)
        {
            client.GetEmploymentTypeCollectionAsync(isShowAll);
            return WebConstants.MagicNumer;
        }

        void DoGetEmploymentTypeCollectionCompleted(object sender, CollectionFeedbackCompletedEventArgs<EmploymentType> e)
        {
            if (GetEmploymentTypeCollectionCompleted != null)
            {
                GetEmploymentTypeCollectionCompleted(sender, e);
            }
        }

        #endregion

        #region DeleteEmploymentType

        public event EventHandler<FeedbackCompletedEventArgs> DeleteEmploymentTypeCompleted;

        public int DeleteEmploymentTypeAsync(int data)
        {
            client.DeleteEmploymentTypeAsync(data);
            return WebConstants.MagicNumer;
        }

        void DoDeleteEmploymentTypeCompleted(object sender, FeedbackCompletedEventArgs e)
        {
            if (DeleteEmploymentTypeCompleted != null)
            {
                DeleteEmploymentTypeCompleted(sender, e);
            }
        }

        #endregion

        #region DeleteEmploymentType

        public event EventHandler<FeedbackCompletedEventArgs> UndoDeleteEmploymentTypeCompleted;

        public int UndoDeleteEmploymentTypeAsync(int data)
        {
            client.UndoDeleteEmploymentTypeAsync(data);
            return WebConstants.MagicNumer;
        }

        void DoUndoDeleteEmploymentTypeCompleted(object sender, FeedbackCompletedEventArgs e)
        {
            if (UndoDeleteEmploymentTypeCompleted != null)
            {
                UndoDeleteEmploymentTypeCompleted(sender, e);
            }
        }

        #endregion

        #region GetSingleEmploymentType

        public event EventHandler<SingleFeedbackCompletedEventArgs<EmploymentType>> GetSingleEmploymentTypeCompleted;

        public int GetSingleEmploymentTypeAsync(int objID)
        {
            client.GetSingleEmploymentTypeAsync(objID);
            return WebConstants.MagicNumer;
        }

        void DoGetSingleEmploymentTypeCompleted(object sender, SingleFeedbackCompletedEventArgs<EmploymentType> e)
        {
            if (GetSingleEmploymentTypeCompleted != null)
            {
                GetSingleEmploymentTypeCompleted(sender, e);
            }
        }

        #endregion
    }
}